<script setup>

const colorList = [
  'rgb(204, 199, 102)',
  'rgb(170, 102, 204)',
  'rgb(102, 204, 195)',
  'rgb(102, 204, 139)',
  'rgb(102, 124, 204)',
  'rgb(153, 204, 102)']

  const props = defineProps({
    index: {
      type: Number,
      required: true
    },
    name: {
      type: String,
      required: true
    },
    value: {
      type: String,
      required: false
    }
  });

</script>

<template>
  <div class="vue-grid-item" style="height: 128px; width: 174px;">
    <div class="card">
      <span class="round1" :style="{ backgroundColor: colorList[index % colorList.length] }"></span>
      <span class="round2" :style="{ backgroundColor: colorList[index % colorList.length] }"></span>
      <div class="topbar">
        <span class="name">{{ name }}</span>
        <div class="el-tooltip remove" tabindex="0">
<!--          <i class="el-icon-delete"></i>-->
        </div>
      </div>
      <div class="value">{{ value }}</div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.chart-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-item {
  flex: 1 1 calc(33.333% - 10px);
}

.chart-card {
  padding-bottom: 20px;
  font-size: 14px;
}

.chart-title {
  color: #0b1019;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart {
  height: 400px;
}

.vue-grid-item {
  position: relative;
  width: 200px;
  height: 150px;
  border: 1px solid rgba(141,146,190,.1);
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;

  .round1 {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: .09;
    transform: translate(-50%,-50%);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
  }
  .round2 {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    opacity: .09;
    position: absolute;
    top: -10px;
    left: 75px;
    z-index: 5;
  }
}
.card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.name {
  font-size: 16px;
  font-weight: bold;
}

.el-tooltip.remove {
  cursor: pointer;
}

.el-icon-delete {
  font-size: 18px;
  color: #ff4d4f;
}

.value {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
}

</style>